import request from '@/utils/request';

export function deleteError(id) {
  return request({
    url: '/system/iam/deleteError/' + id,
    method: 'post'
  })
}

export function listErrorAddRecord(params = {}){
  return request({
    method: 'GET',
    url:"/system/iam/listErrorAddRecord",
    params
  });
}

export function listIamByStuNoYear(params = {}){
  return request({
    method: 'GET',
    url:"/system/iam/listIamByStuNoYear",
    params
  });
}

export function getOwnRecord(year,query={}){
  return request({
    url:"/system/iam/getOwnRecord/"+year,
    method:"get",
    params:query
  })
}

export function fdyAdd(param){
  return request({
    method:"post",
    url:"/system/iam/CounsellorAdd",
    data:param
  });
}


export function getStuByClass(id){
  return request({
    url:"/system/student/list/name?classId="+id,
    method:"get"
  });
}

//学生提交
export function stuAdd(data){
  return request({
    url:"/system/iam/stuAdd",
    method:"post",
    data:data
  });
}

//连表查询
export function listLeftJoin(query){
  return request({
    url:"/system/iam/list",
    method:"get",
    params:query
  });
}


// 查询思想品德列表
export function listIam(query) {
  return request({
    url: '/system/iam/lists',
    method: 'get',
    params: query
  })
}

// 查询思想品德加分项和基础分总和列表
export function listSumScore(query) {
  return request({
    url: '/system/iam/sumList',
    method: 'get',
    params: query
  })
}
//导出思想品德
export function toExport(params={}) {
  return request({
    url: '/system/teacher/exportsxzz',
    method: 'get',
    params
  })
}



// 查询思想品德详细
export function getIam(id) {
  return request({
    url: '/system/iam/' + id,
    method: 'get'
  })
}

// 新增思想品德
export function addIam(data) {
  return request({
    url: '/system/iam',
    method: 'post',
    data: data
  })
}

// 修改思想品德
export function updateIam(data) {
  return request({
    url: '/system/iam/update',
    method: 'post',
    data: data
  })
}

// 删除思想品德
export function delIam(id) {
  return request({
    url: '/system/iam/delete/' + id,
    method: 'post'
  })
}
